#ifndef SCRIPT_MANAGER_H
#define SCRIPT_MANAGER_H

#include <OgreMemoryAllocatorConfig.h>
#include <OgreSingleton.h>
#include <OgreString.h>

#include <map>

#include "IScriptPlugin.h"
    
namespace ScriptPlug
{
    class SCRIPT_MANAGER_EXPORT ScriptManager : public Ogre::Singleton<ScriptManager>, public Ogre::GeneralAllocatedObject
    {
    public:
        ScriptManager();
        ~ScriptManager();

        // registers a script plugin, putting it into scriptPlugins. ScriptPlugins must have unique names (as returned by Ogre::Plugin::getName())
        void Register(IScriptPlugin* scriptPlugin);
        void UnRegister(IScriptPlugin* scriptPlugin);
        IScriptPlugin* GetScriptPlugin(Ogre::String name);
        
    private:
        std::map<Ogre::String, IScriptPlugin*> scriptPlugins;
    };
}

#endif // SCRIPT_MANAGER_H